package filetest;

import java.io.File;
import java.io.FileFilter;

public class Test06 {
    public static void main(String[] args) {
        File dir = new File("./src");

        if (dir.isDirectory()) {
            FileFilter filter = (File file) ->  file.getName().contains("s");




                File[] subs = dir.listFiles(filter);
                for (File sub : subs) {
                    System.out.println(sub.getName());
                }
            }


                    /*if (dir.isDirectory()) {
                        FileFilter filter = new FileFilter() {
                            @Override
                            public boolean accept(File pathname) {
                                String name = pathname.getName();
                                return name.contains("s");
                            }
                        };
                        File[] subs = dir.listFiles(filter);
                        for (File sub:subs){
                            System.out.println(sub.getName());
                        }
                    }*/



        }
    }
